# -*- cmake -*-

# Find the OpenSSL engines
#
# OPENSSL_ENGINES_LIBRARIES - the libraries
# OPENSSL_ENGINES_FOUND - have we found them?

SET(OPENSSL_ENGINE_4758CCA ${OPENSSL_ENGINE_4758CCA}
lib4758cca lib4758ccaeay32 4758cca 4758ccaeay32 engines/lib4758cca engines/lib4758ccaeay32 engines/4758cca engines/4758ccaeay32)
FIND_LIBRARY(OPENSSL_ENGINE_4758CCA_LIBRARY NAMES ${OPENSSL_ENGINE_4758CCA} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_AEP ${OPENSSL_ENGINE_AEP}
libaep libaepeay32 aep aepeay32 engines/libaep engines/libaepeay32 engines/aep engines/aepeay32)
FIND_LIBRARY(OPENSSL_ENGINE_AEP_LIBRARY NAMES ${OPENSSL_ENGINE_AEP} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_ATALLA ${OPENSSL_ENGINE_ATALLA}
libatalla libatallaeay32 atalla atallaeay32 engines/libatalla engines/libatallaeay32 engines/atalla engines/atallaeay32)
FIND_LIBRARY(OPENSSL_ENGINE_ATALLA_LIBRARY NAMES ${OPENSSL_ENGINE_ATALLA} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_CAPI ${OPENSSL_ENGINE_CAPI}
libcapi libcapieay32 capi capieay32 engines/libcapi engines/libcapieay32 engines/capi engines/capieay32)
FIND_LIBRARY(OPENSSL_ENGINE_CAPI_LIBRARY NAMES ${OPENSSL_ENGINE_CAPI} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_CHIL ${OPENSSL_ENGINE_CHIL}
libchil libchileay32 chil chileay32 engines/libchil engines/libchileay32 engines/chil engines/chileay32)
FIND_LIBRARY(OPENSSL_ENGINE_CHIL_LIBRARY NAMES ${OPENSSL_ENGINE_CHIL} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_CSWIFT ${OPENSSL_ENGINE_CSWIFT}
libcswift libcswifteay32 cswift cswifteay32 engines/libcswift engines/libcswifteay32 engines/cswift engines/cswifteay32)
FIND_LIBRARY(OPENSSL_ENGINE_CSWIFT_LIBRARY NAMES ${OPENSSL_ENGINE_CSWIFT} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_GMP ${OPENSSL_ENGINE_GMP}
libgmp libgmpeay32 gmp gmpeay32 engines/libgmp engines/libgmpeay32 engines/gmp engines/gmpeay32)
FIND_LIBRARY(OPENSSL_ENGINE_GMP_LIBRARY NAMES ${OPENSSL_ENGINE_GMP} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_GOST ${OPENSSL_ENGINE_GOST}
libgost libgosteay32 gost gosteay32 engines/libgost engines/libgosteay32 engines/gost engines/gosteay32)
FIND_LIBRARY(OPENSSL_ENGINE_GOST_LIBRARY NAMES ${OPENSSL_ENGINE_GOST} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_NURON ${OPENSSL_ENGINE_NURON}
libnuron libnuroneay32 nuron nuroneay32 engines/libnuron engines/libnuroneay32 engines/nuron engines/nuroneay32)
FIND_LIBRARY(OPENSSL_ENGINE_NURON_LIBRARY NAMES ${OPENSSL_ENGINE_NURON} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_PADLOCK ${OPENSSL_ENGINE_PADLOCK}
libpadlock libpadlockeay32 padlock padlockeay32 engines/libpadlock engines/libpadlockeay32 engines/padlock engines/padlockeay32)
FIND_LIBRARY(OPENSSL_ENGINE_PADLOCK_LIBRARY NAMES ${OPENSSL_ENGINE_PADLOCK} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_SUREWARE ${OPENSSL_ENGINE_SUREWARE}
libsureware libsurewareeay32 sureware surewareeay32 engines/libsureware engines/libsurewareeay32 engines/sureware engines/surewareeay32)
FIND_LIBRARY(OPENSSL_ENGINE_SUREWARE_LIBRARY NAMES ${OPENSSL_ENGINE_SUREWARE} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ENGINE_UBSEC ${OPENSSL_ENGINE_UBSEC}
libubsec libubseceay32 ubsec ubseceay32 engines/libubsec engines/libubseceay32 engines/ubsec engines/ubseceay32)
FIND_LIBRARY(OPENSSL_ENGINE_UBSEC_LIBRARY NAMES ${OPENSSL_ENGINE_UBSEC} PATHS /usr/lib/engines /usr/local/lib/engines)

SET(OPENSSL_ALL_ENGINE_LIBRARIES ${OPENSSL_ENGINE_4758CCA_LIBRARY} ${OPENSSL_ENGINE_AEP_LIBRARY} ${OPENSSL_ENGINE_ATALLA_LIBRARY}
${OPENSSL_ENGINE_CAPI_LIBRARY} ${OPENSSL_ENGINE_CHIL_LIBRARY} ${OPENSSL_ENGINE_CSWIFT_LIBRARY}
${OPENSSL_ENGINE_GMP_LIBRARY} ${OPENSSL_ENGINE_GOST_LIBRARY} ${OPENSSL_ENGINE_NURON_LIBRARY}
${OPENSSL_ENGINE_PADLOCK_LIBRARY} ${OPENSSL_ENGINE_SUREWARE_LIBRARY} ${OPENSSL_ENGINE_UBSEC_LIBRARY})

SET(OPENSSL_ENGINES_FOUND FALSE)
IF (OPENSSL_ENGINE_4758CCA_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_4758CCA_LIBRARY)
IF (OPENSSL_ENGINE_AEP_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_AEP_LIBRARY)
IF (OPENSSL_ENGINE_ATALLA_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_ATALLA_LIBRARY)
IF (OPENSSL_ENGINE_CAPI_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_CAPI_LIBRARY)
IF (OPENSSL_ENGINE_CHIL_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_CHIL_LIBRARY)
IF (OPENSSL_ENGINE_CSWIFT_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_CSWIFT_LIBRARY)
IF (OPENSSL_ENGINE_GMP_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_GMP_LIBRARY)
IF (OPENSSL_ENGINE_GOST_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_GOST_LIBRARY)
IF (OPENSSL_ENGINE_NURON_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_NURON_LIBRARY)
IF (OPENSSL_ENGINE_PADLOCK_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_PADLOCK_LIBRARY)
IF (OPENSSL_ENGINE_SUREWARE_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_SUREWARE_LIBRARY)
IF (OPENSSL_ENGINE_UBSEC_LIBRARY)
   SET(OPENSSL_ENGINES_FOUND TRUE)
ENDIF (OPENSSL_ENGINE_UBSEC_LIBRARY)

MARK_AS_ADVANCED(OPENSSL_ALL_ENGINE_LIBRARIES OPENSSL_ENGINES_FOUND)
